/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package fr.uniscol.dao.mapper;

import fr.uniscol.model.Matiere;
import fr.uniscol.model.Option;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.jdbc.core.RowMapper;

/**
 *
 * @author Christophe
 */
public class OptionRowMapper implements RowMapper<Option> {

    @Override
    public Option mapRow(ResultSet rs, int rowNum) throws SQLException {
        
        Option o = new Option();
        
        o.setMatiere(new Matiere());
        o.getMatiere().setId(rs.getLong("MATIEREID"));
        o.getMatiere().setLibelleLong(rs.getString("LIBELLE_LONG"));
        o.setModalite(rs.getString("MODALITE"));
        
        return o;
    }
}
